Naming conventions are commonly used to increase the readability of source code. Naming conventions frequently define certain prefixes for variables depending on the date type, visibility and other metadata associated with each variable. (Naming conventions are also sometimes referred to as metadata conventions.) Consider various prefixes that can be used to distinguish data types in variables. For example, the prefix REF may indicate a reference to an object, the prefix TAB may refer to an internal table, the prefix STR may refer to a structure, etc. With respect to visibility, the prefix L, for example, may refer to a local variable, while the prefix G may refer to a global variable, etc. With respect to parameters, the prefix I, for example, may refer to an importing operation whereas the prefix E may refer to an exporting operation. In this way, a variety of prefixes may be used to describe the variable. Thus, a variable titled “city” may also have multiple prefixes such as a data type prefix, visibility prefix and/or a parameter prefix.
The examples of prefixes described above are frequently used by developers to provide them with additional information about the variables that they are using. However, there are several problems that can arise in using a particular naming convention to label variables with prefixes. For example, developers and others frequently disagree about the naming convention (e.g., which labels to use for various prefixes). In addition, naming conventions can lead to inconsistencies, for example, if someone changes the type of the variable but forgets to adjust its name and/or its prefix accordingly. Also, some people feel that the use of prefixes deflects from the main intention of the variable which is to represent a particular thing (e.g., city, population, etc.).
Prefixes naming conventions must be followed by developers, necessitating that they be familiar with the rules for building the variable names. Typically naming conventions change over time or multiple naming conventions exist in parallel at the same time. This occurs especially in large organizations. Thus, not only can the choice of naming conventions be an enormously controversial issue (with partisans of each convention holding theirs to be the best and others to be inferior), but each person may have difficulty adapting to naming conventions as they are chosen or changed.
A typical approach to enforce the right usage of naming conventions is to check the adherence of each developer by using a check program. In check programs, the rules are programmed and/or configured and checked automatically. When violations occur, developers receive e-mails indicating violations and instructing them to correct the violations.